package utils;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.handler.timeout.IdleStateHandler;



public class CustomerHandleInitializer extends ChannelInitializer<Channel> {
    @Override
    protected void initChannel(Channel channel) throws Exception {
        channel.pipeline()
                //10 秒没发送消息 将IdleStateHandler 添加到 ChannelPipeline 中,
                //修改健康监测机制轮训时间
                //readeridleTimeSeconds 测试端一定时间内未接受到被测试端消息
                //writeridleTimeSeconds  测试端一定时间内向被测试端发送消息
                //allidleTimeSecond
                // s  所有类型的超时时间
                .addLast(new IdleStateHandler(0, 5, 0))
                .addLast(new HeartbeatEncode())
                .addLast(new EchoClientHandle());
    }
}
